import request from '@/utils/request'
const baseURL = '/course'


// 获取分配和未分配课程进行展示
export const getUnAssignCourseList = (assginCourse) => request({
    url: `${baseURL}/getUnAssignCourseList?classId=${assginCourse.classId}&deptId=${assginCourse.deptId}&semesterId=${assginCourse.semesterId}`,
    method: 'GET'
})


// 分配课程
export const assignCourse = (course) => request({
    url: `${baseURL}/assignCourse`,
    method: 'POST',
    data: course
})

// 添加课程
export const addCourse = (course) => request({
    url: `${baseURL}/addCourse`,
    method: 'POST',
    data: course
})

//删除课程
export const deleteCourse = (deptId, courseId) => request({
    url: `${baseURL}/deleteCourse/${deptId}/${courseId}`,
    method: 'DELETE'
})

// 修改课程
export const updateCourse = (course) => request({
    url: `${baseURL}/updateCourse`,
    method: 'PUT'
})


// 获取课程的详细信息
export const getAllCourseDetail = (queyrParams) => request({
    url: `/class-course/getAllClassCourseDetail`,
    method: 'POST',
    data: queyrParams
})


// 为班级课程分配对应老师
export const assignTeacherApi = (classCourse) => request({
    url: `/class-course/assignteacher`,
    method: "POST",
    data: classCourse
})

// 修改授课老师
export const updateTeacher = (classCourse) => request({
    url: `/class-course/updateteacher`,
    method: "PUT",
    data: classCourse
})

//根据教师id获取教师教授的课程
export const getCourseByTeacherId = () => request({
    url: `${baseURL}/teacher`,
    method: 'get'
})

//获取当前课程信息
// 获取当前学生的课程信息
export const getAllCourseDetailByStudentId = (queryParams) => request({
    url: `/student-course/getCourseById`,
    method: 'POST',
    data: queryParams
})
